package com.wanmait.baohan.service.Impl;

import com.github.pagehelper.PageInfo;
import com.wanmait.baohan.mapper.CapitalExpenditureMapper;
import com.wanmait.baohan.pojo.CapitalExpenditure;
import com.wanmait.baohan.service.CapitalExpenditureService;

import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class CapitalExpenditureServiceImpl implements CapitalExpenditureService {

    @Resource
    CapitalExpenditureMapper capitalExpenditureMapper;

    @Override
    public void insert(CapitalExpenditure object) {

    }

    @Override
    public void delete(Integer id) {

    }

    @Override
    public void delete(String ids) {

    }

    @Override
    public void update(CapitalExpenditure object) {
        capitalExpenditureMapper.updateByPrimaryKeySelective(object);
    }

    @Override
    public CapitalExpenditure findById(Integer id) {
        return null;
    }

    @Override
    public List<CapitalExpenditure> findAll() {
        return capitalExpenditureMapper.findAll();

       // return null;//capitalExpenditureMapper.selectList();
    }

    @Override
    public List<CapitalExpenditure> findAll(CapitalExpenditure capitalExpenditure) {
        return null;

    }

    @Override
    public PageInfo<CapitalExpenditure> findPage(int pageNum) {
        return null;
    }


    @Override
    public PageInfo<CapitalExpenditure> findPage() {
        //int pageSize=configMapper.findIntValue("manage_questionType_pageSize");
        //PageHelper.startPage();
        return null;
    }

    @Override
    public PageInfo<CapitalExpenditure> findPage(int pageNum, CapitalExpenditure object) {
        return null;
    }

    @Override
    public PageInfo<CapitalExpenditure> findPage(CapitalExpenditure object) {
        return null;
    }




    @Override
    public PageInfo<CapitalExpenditure> selectAllCapitalExpenditure(Integer page, Integer limit) {

        PageHelper.startPage(page,limit);
        List<CapitalExpenditure> capitalExpenditureList = capitalExpenditureMapper.findAll();
        PageInfo<CapitalExpenditure> capitalExpenditurePageInfo = new PageInfo<>(capitalExpenditureList,7);

        return capitalExpenditurePageInfo;
    }
}
